Fix "File name too long" error when a title is used as a folder name - #1479
Merged
jmbannon merged 1 commit intoJun 23, 2026
Merged
Conversation
Contributor
Author
|
Please rerun CI, seems like there is a flaky issue unrelated to my changes. |
jmbannon
reviewed
Jun 23, 2026
| def post_process(self, resolved: str) -> str: | ||
| return FilePathTruncater.to_native_filepath( | ||
| FilePathTruncater.maybe_truncate_file_path(resolved) | ||
| FilePathTruncater.maybe_truncate_file_name_path(resolved) |
Owner
There was a problem hiding this comment.
is maybe_truncate_file_path still used? If not lets remove it
Contributor
Author
There was a problem hiding this comment.
It seems to be still used and should not be removed I think.
Owner
|
The failed test seems legit, something changed to the file paths but only in Windows? I will try to investigate tomorrow |
Owner
|
Welp, you are right! This is indeed a pre-existing failure (and a very strange one). Merging now, thanks for this change! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some presets put the video title into a folder name (not just the file name). The code only shortened the file name, never the folder name. So a title with multi-byte characters (like bold/fancy Unicode, which take 4 bytes each) could make the folder name go over the OS 255-byte limit and crash with OSError: [Errno 36] File name too long.
This fix shortens every folder in the path too, not just the file name, while keeping the file extension. output_directory is left alone so real folders aren't touched.
Added a test with a title made of 4-byte bold Unicode characters.
Relates to #1092, #1189